/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg_entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Oswaldo
 */
@Entity
@Table(name = "sope_operacion", catalog = "sisventas_db", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Operacion.findAll", query = "SELECT o FROM Operacion o"),
    @NamedQuery(name = "Operacion.findByOpeCodigo", query = "SELECT o FROM Operacion o WHERE o.opeCodigo = :opeCodigo"),
    @NamedQuery(name = "Operacion.findByOpeFecha", query = "SELECT o FROM Operacion o WHERE o.opeFecha = :opeFecha"),
    @NamedQuery(name = "Operacion.findByOpeCantidad", query = "SELECT o FROM Operacion o WHERE o.opeCantidad = :opeCantidad"),
    @NamedQuery(name = "Operacion.findByOpeCalifcom", query = "SELECT o FROM Operacion o WHERE o.opeCalifcom = :opeCalifcom"),
    @NamedQuery(name = "Operacion.findByOpeCalifven", query = "SELECT o FROM Operacion o WHERE o.opeCalifven = :opeCalifven"),
    @NamedQuery(name = "Operacion.findByOpeComencom", query = "SELECT o FROM Operacion o WHERE o.opeComencom = :opeComencom"),
    @NamedQuery(name = "Operacion.findByOpeComenven", query = "SELECT o FROM Operacion o WHERE o.opeComenven = :opeComenven"),
    @NamedQuery(name = "Operacion.findByOpeFechcalicom", query = "SELECT o FROM Operacion o WHERE o.opeFechcalicom = :opeFechcalicom"),
    @NamedQuery(name = "Operacion.findByOpeFechcaliven", query = "SELECT o FROM Operacion o WHERE o.opeFechcaliven = :opeFechcaliven")})
public class Operacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ope_codigo")
    private Integer opeCodigo;
    @Column(name = "ope_fecha")
    @Temporal(TemporalType.DATE)
    private Date opeFecha;
    @Column(name = "ope_cantidad")
    private Integer opeCantidad;
    @Column(name = "ope_califcom")
    private Character opeCalifcom;
    @Column(name = "ope_califven")
    private Character opeCalifven;
    @Size(max = 150)
    @Column(name = "ope_comencom")
    private String opeComencom;
    @Size(max = 150)
    @Column(name = "ope_comenven")
    private String opeComenven;
    @Column(name = "ope_fechcalicom")
    @Temporal(TemporalType.DATE)
    private Date opeFechcalicom;
    @Column(name = "ope_fechcaliven")
    @Temporal(TemporalType.DATE)
    private Date opeFechcaliven;
    @JoinColumn(name = "usr_codigo", referencedColumnName = "usr_codigo")
    @ManyToOne
    private Usuario usrCodigo;
    @JoinColumn(name = "aos_codigo", referencedColumnName = "aos_codigo")
    @ManyToOne
    private Artiserv aosCodigo;

    public Operacion() {
    }

    public Operacion(Integer opeCodigo) {
        this.opeCodigo = opeCodigo;
    }

    public Integer getOpeCodigo() {
        return opeCodigo;
    }

    public void setOpeCodigo(Integer opeCodigo) {
        this.opeCodigo = opeCodigo;
    }

    public Date getOpeFecha() {
        return opeFecha;
    }

    public void setOpeFecha(Date opeFecha) {
        this.opeFecha = opeFecha;
    }

    public Integer getOpeCantidad() {
        return opeCantidad;
    }

    public void setOpeCantidad(Integer opeCantidad) {
        this.opeCantidad = opeCantidad;
    }

    public Character getOpeCalifcom() {
        return opeCalifcom;
    }

    public void setOpeCalifcom(Character opeCalifcom) {
        this.opeCalifcom = opeCalifcom;
    }

    public Character getOpeCalifven() {
        return opeCalifven;
    }

    public void setOpeCalifven(Character opeCalifven) {
        this.opeCalifven = opeCalifven;
    }

    public String getOpeComencom() {
        return opeComencom;
    }

    public void setOpeComencom(String opeComencom) {
        this.opeComencom = opeComencom;
    }

    public String getOpeComenven() {
        return opeComenven;
    }

    public void setOpeComenven(String opeComenven) {
        this.opeComenven = opeComenven;
    }

    public Date getOpeFechcalicom() {
        return opeFechcalicom;
    }

    public void setOpeFechcalicom(Date opeFechcalicom) {
        this.opeFechcalicom = opeFechcalicom;
    }

    public Date getOpeFechcaliven() {
        return opeFechcaliven;
    }

    public void setOpeFechcaliven(Date opeFechcaliven) {
        this.opeFechcaliven = opeFechcaliven;
    }

    public Usuario getUsrCodigo() {
        return usrCodigo;
    }

    public void setUsrCodigo(Usuario usrCodigo) {
        this.usrCodigo = usrCodigo;
    }

    public Artiserv getAosCodigo() {
        return aosCodigo;
    }

    public void setAosCodigo(Artiserv aosCodigo) {
        this.aosCodigo = aosCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (opeCodigo != null ? opeCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Operacion)) {
            return false;
        }
        Operacion other = (Operacion) object;
        if ((this.opeCodigo == null && other.opeCodigo != null) || (this.opeCodigo != null && !this.opeCodigo.equals(other.opeCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pkg_entidades.Operacion[ opeCodigo=" + opeCodigo + " ]";
    }
    
}
